<?xml version="1.0"?>
<Template Originator="Mike Kestner" Created="2/11/2009" LastModified="2/11/2009">
  <TemplateConfiguration>
    <_Name>Custom Drawn Widget</_Name>
    <Icon>md-gui-file</Icon>
    <_Category>Gtk</_Category>
    <LanguageName>*</LanguageName>
    <ProjectType>DotNetAssembly</ProjectType>
    <_Description>Creates a custom Gtk.DrawingArea subclass.</_Description>
    <DefaultFilename>DrawingArea</DefaultFilename>
  </TemplateConfiguration>
  <Conditions>
    <HasReference Assembly="gtk-sharp" />
  </Conditions>
  <TemplateFiles>
    <CodeDomFile>
       <CompileUnit>
         <Namespaces>
          <Namespace Name="">
            <Imports>
              <NamespaceImport Namespace="System" />
            </Imports>
          </Namespace>
          <Namespace Name="${Namespace}">
            <Types>
              <TypeDeclaration Name="${Name}" IsClass="true">
                <BaseTypes>
                  <TypeReference BaseType="Gtk.DrawingArea" />
                </BaseTypes>
                <CustomAttributes>
                  <AttributeDeclaration Name="System.ComponentModel.ToolboxItem">
                    <Arguments>
                      <AttributeArgument>
                        <Value><PrimitiveExpression Value="True" ValueType="System.Boolean"/></Value>
                      </AttributeArgument>
                    </Arguments>
                  </AttributeDeclaration>
                </CustomAttributes>
                <Members>
                  <Constructor Attributes="Public, Final">
                    <Statements>
                      <CommentStatement>
                        <Comment>
                          <Comment Text="Insert initialization code here." />
                        </Comment>
                      </CommentStatement>
                    </Statements>
                  </Constructor>
                  <MemberMethod Name="OnButtonPressEvent" Attributes="Family, Override">
                    <Parameters>
                      <ParameterDeclarationExpression Name="ev" Type="Gdk.EventButton"/>
                    </Parameters>
                    <ReturnType><TypeReference BaseType="System.Boolean"/></ReturnType>
                    <Statements>
                      <CommentStatement>
                        <Comment>
                          <Comment Text="Insert button press handling code here." />
                        </Comment>
                      </CommentStatement>
                      <MethodReturnStatement>
                        <Expression>
                          <MethodInvokeExpression>
                            <Method>
                              <MethodReferenceExpression MethodName="OnButtonPressEvent">
                                <TargetObject>
                                  <BaseReferenceExpression/>
                                </TargetObject>
                              </MethodReferenceExpression>
                            </Method>
                            <Parameters>
                              <ArgumentReferenceExpression ParameterName="ev" />
                            </Parameters>
                          </MethodInvokeExpression>
                        </Expression>
                      </MethodReturnStatement>
                    </Statements>
                  </MemberMethod>
                  <MemberMethod Name="OnExposeEvent" Attributes="Family, Override">
                    <Parameters>
                      <ParameterDeclarationExpression Name="ev" Type="Gdk.EventExpose"/>
                    </Parameters>
                    <ReturnType><TypeReference BaseType="System.Boolean"/></ReturnType>
                    <Statements>
                      <MethodInvokeExpression>
                        <Method>
                          <MethodReferenceExpression MethodName="OnExposeEvent">
                            <TargetObject>
                              <BaseReferenceExpression/>
                            </TargetObject>
                          </MethodReferenceExpression>
                        </Method>
                        <Parameters>
                          <ArgumentReferenceExpression ParameterName="ev" />
                        </Parameters>
                      </MethodInvokeExpression>
                      <CommentStatement>
                        <Comment>
                          <Comment Text="Insert drawing code here." />
                        </Comment>
                      </CommentStatement>
                      <MethodReturnStatement>
                        <Expression>
                          <PrimitiveExpression Value="True" ValueType="System.Boolean"/>
                        </Expression>
                      </MethodReturnStatement>
                    </Statements>
                  </MemberMethod>
                  <MemberMethod Name="OnSizeAllocated" Attributes="Family, Override">
                    <Parameters>
                      <ParameterDeclarationExpression Name="allocation" Type="Gdk.Rectangle" />
                    </Parameters>
                    <Statements>
                      <MethodInvokeExpression>
                        <Method>
                          <MethodReferenceExpression MethodName="OnSizeAllocated">
                            <TargetObject>
                              <BaseReferenceExpression/>
                            </TargetObject>
                          </MethodReferenceExpression>
                        </Method>
                        <Parameters>
                          <ArgumentReferenceExpression ParameterName="allocation" />
                        </Parameters>
                      </MethodInvokeExpression>
                      <CommentStatement>
                        <Comment>
                          <Comment Text="Insert layout code here." />
                        </Comment>
                      </CommentStatement>
                    </Statements>
                  </MemberMethod>
                  <MemberMethod Name="OnSizeRequested" Attributes="Family, Override">
                    <Parameters>
                      <ParameterDeclarationExpression Name="requisition" Type="Gtk.Requisition" Direction="Ref" />
                    </Parameters>
                    <Statements>
                      <CommentStatement>
                        <Comment>
                          <Comment Text="Calculate desired size here." />
                        </Comment>
                      </CommentStatement>
                      <AssignStatement>
                        <Left>
                          <FieldReferenceExpression FieldName="Height">
                            <TargetObject>
                              <ArgumentReferenceExpression ParameterName="requisition" />
                            </TargetObject>
                          </FieldReferenceExpression>
                        </Left>
                        <Right>
                          <PrimitiveExpression Value="50" ValueType="System.Int32" />
                        </Right>
                      </AssignStatement>
                      <AssignStatement>
                        <Left>
                          <FieldReferenceExpression FieldName="Width">
                            <TargetObject>
                              <ArgumentReferenceExpression ParameterName="requisition" />
                            </TargetObject>
                          </FieldReferenceExpression>
                        </Left>
                        <Right>
                          <PrimitiveExpression Value="50" ValueType="System.Int32" />
                        </Right>
                      </AssignStatement>
                    </Statements>
                  </MemberMethod>
                </Members>
              </TypeDeclaration>
            </Types>
          </Namespace>
        </Namespaces>
      </CompileUnit>
    </CodeDomFile>
  </TemplateFiles>
</Template>
